<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>贪吃蛇小游戏</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <div class="container">
        <h1>贪吃蛇</h1>
        <div class="score-board">
            <div class="score">得分: <span id="current-score">0</span></div>
            <div class="high-score">最高分: <span id="high-score">0</span></div>
        </div>
        <canvas id="game-canvas" width="400" height="400"></canvas>
        <div class="controls">
            <button id="start-btn" class="btn">开始游戏</button>
            <button id="restart-btn" class="btn" style="display: none;">重新开始</button>
        </div>
        <div class="instructions">
            <p>使用方向键 ↑ ↓ ← → 控制蛇的移动</p>
        </div>
    </div>
    <div id="game-over-modal" class="modal" style="display: none;">
        <div class="modal-content">
            <h2>游戏结束</h2>
            <p>最终得分: <span id="final-score">0</span></p>
            <button id="restart-modal-btn" class="btn">再来一局</button>
        </div>
    </div>
    <script src="snake.js"></script>
</body>
</html>
